import getpass
name_input = ""
word_input = ""
name = "周道镕"
word = "1719932187"
while True:
    name_input1 = input("请输入用户名：")
    name_input = name_input1.replace(' ', '')
    if name_input == "":
        print("用户名不能为空！")
        continue
    # word_input1 = getpass.getpass("请输入密码：")
    word_input1 = input("请输入你的密码： ")
    word_input = word_input1.replace(' ', '')
    if word_input == "":
        print("密码不能为空！")
        continue
    if name_input == name and word_input == word:
        print("登录成功")
        break
    else:
        print("用户名或密码错误，请重新输入：")
print("——————————————————————————————")
good = """
                商品列表
no                  name                  price
 1                  电脑                  1999
 2                  鼠标                  60
 3                  游艇                  999999  
 4                  美女                  998
 5                  章超印的内裤           999
 如果购买完成，请按q或Q键退出结算！！！
"""
print(good)
num = ""
sum = 0
while True:
    num1 = input("请输入你想买的东西的序号：")
    num = num1.replace(' ', '')
    if num == "1":
        mon = 1999
        sum += mon
        print("电脑    1999")
    elif num == "2":
        mon = 60
        sum += mon
        print("鼠标    60")
    elif num == "3":
        mon = 999999
        sum += mon
        print("游艇    999999")
    elif num == "4":
        mon = 998
        sum += mon
        print("美女    998")
    elif num == "5":
        mon = 999
        sum += mon
        print("章超印的内裤    999")
    elif num == "-1":
        mon =1999
        sum -= mon
        print("已减去这件商品")
    elif num == "-2":
        mon =60
        sum -= mon
        print("已减去这件商品")
    elif num == "-3":
        mon =999999
        sum -= mon
        print("已减去这件商品")
    elif num == "-4":
        mon =998
        sum -= mon
        print("已减去这件商品")
    elif num == "-5":
        mon =999
        sum -= mon
        print("已减去这件商品")
    elif num == "q" or num == "Q":
        print("退出程序")
        print("总金额：" + str(sum))
        break
    else:
        print("输入有误")
        continue
    print("请问你还要购买吗？"+ "如果你想删除这件物品请在物品序号前加个“-”号！"+"你现在的累计金额为："+str(sum))
